#装饰器写法

def decorator(func):
    def wrapper(*args, **kwargs):
        print('start')
        func(*args, **kwargs)
        print('end')
    return wrapper

def test():
    print('test')

@decorator
def test2():
    print('test')

if __name__ == '__main__':
    # test = decorator(test)
    # test()

    test2()